<?php
/* 
 * Amilcar de Leon
 * funcion para contar todos los registros de joke
 *
 */
include_once $_SERVER['DOCUMENT_ROOT'] . '/PHPLearning2011/includes/db.inc.php';

function totaljokes()
{
    

    $result=mysqli_query($GLOBALS['link'], 'SELECT COUNT(*) FROM joke');
    if (!$result)
    {
        $error='Error de BD contando jokes!';
        include 'error.html.php';
        exit();
    }
    $row=mysqli_fetch_array($result);
    return $row[0];

}


?>
